var token=localStorage.getItem("key");
$.ajax({
	type:"get",
	url:"/api/meetingroom/getCollect",
	async:true,
	data:{"token":token,"page":1,"pageSize":20},
	dataType:"json",
	success:function(data){
		console.log(data.data);
		var list=data.data;
		if(list!='[]'&&list.length>0){
			for(var i=0;i<list.length;i++){
			var str='<div class="s-item-wrap">'+
						'<div class="s-item">'+
		
							'<div class="s-pic">'+
								'<a href="../home/introduction.html?id='+list[i].goodsId+'" class="s-pic-link">'+
									'<img src="'+list[i].imgUrl+'"  title="'+list[i].goodName+'" class="s-pic-img s-guess-item-img">'+
								'</a>'+
							'</div>'+
							'<div class="s-info">'+
								'<div class="s-title"><a href="../home/introduction.html?id='+list[i].goodsId+'" title="'+list[i].goodName+'">'+list[i].goodName+'</a></div>'+
								'<div class="s-price-box">'+
									'<span class="s-price"><em class="s-price-sign">¥</em><em class="s-value">'+list[i].goodPrice+'</em></span>'+
								'</div>'+
								'<div class="s-extra-box">'+
									'<span class="s-sales">月销: '+list[i].payNum+'</span>'+
								'</div>'+
							'</div>'+
							'<div class="s-tp">'+
								'<span class="ui-btn-loading-before" onclick="cancleColl(\''+list[i].goodsId+'\')">取消收藏</span>'+
							'</div>'+
						'</div>'+
					'</div>';
				$('.s-content').append(str);
			}
		}
	}
});
function cancleColl(id){
	$.ajax({
		type:"get",
		url:"/api/meetingroom/collectGoods",
		async:true,
		data:{"token":token,"goodsid":id,"isCollect":0},
		dataType:"json",
		success:function(data){
			window.location.reload();
		}
	});
}
